package com.ys.object;

/**
 * @author CodeYang
 * @Description
 * @Date 2020/12/12 15:15
 */
public class 面向对象03构造方法 {

    // Construtor  构造函数
    /**
     *  构造方法必须 通过new 关键字来调用
     */
   static int a = 3, b = 5;

    public static void main(String[] args) {

        System.out.println("a = " + a + "\t b = " + b);
        System.out.println("使用构造方法来交换变量值:");
        SwapObject object = new SwapObject(a, b);
        System.out.println(object);
        System.out.println("a = " + object.a + "\t b = " + object.b);
    }

}
